import axios from "axios";

export const loginApi = (userName:string) => {
   return  axios.post(
        '/api/auth/login',
        {
            userName
        }
    )
}
// ######################
export const findFriendsByNameApi = (userName:string) => {
    return  axios.post(
         '/api/chartUser/queryUsersByName',
         {
             userName
         }
     )
 }


 export const addFirednApi = (userName:string,friendName:string) => {
    return  axios.post(
         '/api/chartUser/addFriend',
         {
             userName,
             friendName
         }
     )
 }


 export const getFriendApplyListApi = (userName:string) => {
    return  axios.get(
         `/api/chartUser/getFriendApplyList?userName=${userName}`,
     )
 }
 
 export const confirmNewFriendApplyApi = (userName:string,friendName:string) => {
    return  axios.post(
         '/api/chartUser/confirmNewFriendApply',
         {
             userName,
             friendName
         }
     )
 }
 

 export const getAllfriendsApi = (userName:string) => {
    return  axios.get(
         `/api/chartUser/getAllFriends?userName=${userName}`,
     )
 }
 

 export const getChartRecordApi = (userName:string,friendName:string) => {
    return  axios.get(
         `/api/chartUser/getChartRecord/${userName}/${friendName}`,
     )
 }